-
Notifications
You must be signed in to change notification settings - Fork 74
Add 2 more Expr simplifications related to negative numbers, enable NOT concretization #1017
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
5e9c8a2 to
1044b7f
Compare
blishko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Co-authored-by: blishko <blishko@argot.org>
Co-authored-by: blishko <blishko@argot.org>
src/EVM/Expr.hs
Outdated
|
|
||
| -- Negation: ~x + 1 = 0 - x (two's complement) | ||
| go (Add (Lit 1) (Not b)) = Sub (Lit 0) b | ||
| go (Xor (Lit a) b) | a == maxLit = Not b |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move the Xor rule to the Xor section below.
Also, not sure what will happen if b is a literal. I guess the result should actually be Expr.not b? WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm moving it lower down. It'll make it into Not b which SHOULD call EVM.Expr.not to simplify concrete values but that's missing! WOW. Oooooops. We literally never simplify negated concrete values :S Adding that into this PR.
Co-authored-by: blishko <blishko@argot.org>
Co-authored-by: blishko <blishko@argot.org>
47e30f5 to
31d4ef9
Compare
blishko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Description
Adds two new rewrites:
Checklist